<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        async function fun1() {
            return Promise.reject("Promise is rejected in async function");
            return Promise.resolve("Promise is resolved in async function");
            throw new Error("An error occurred in async function");
        }
        fun1().then(function (value) {
            console.log("value:" + value);
        }).catch(function (err) {
            console.log("err: " + err);
        });
    </script>
</body>

</html>